home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / G4C / CED / GuideEd.g < prev    next >
Encoding:
Gui4CLI script  |  1999-11-24  |  1.9 KB  |  96 lines

  1. G4C
  2.  
  3. WINBIG 620 24 25 114 'AG'
  4. WinType 010000
  5. usetopaz
  6. varpath cedbar.gc
  7.  
  8. xOnLoad
  9.     guiopen #this
  10.  
  11. xOnReload
  12.     guiopen #this
  13.  
  14. xOnRMB
  15.     GuiClose #this
  16.  
  17. ; -----------------------------------------------------
  18. ;    Edit guide
  19. ; -----------------------------------------------------
  20.  
  21. XICON 0 0 ":icons/AGNew"
  22.     gadid 11
  23.     guiload :addnode.g GUIDE
  24.  
  25. XICON 0 14 ":icons/AGNode"
  26.     gadid 11
  27.     guiload :addnode.g NODE
  28.  
  29. XICON 0 42 ":icons/AGLink"
  30.     gadid 11
  31.     guiload :addlink.g
  32.  
  33. XICON 0 28 ":icons/AGfx"
  34.     gadid 11
  35.     guiload :addeffect.g
  36.  
  37. XICON 0 56 ":icons/AGClear"
  38.     gadid 11
  39.     ; cut the selected text into our lv
  40.     SendRexx $cedport cut
  41.     lvuse CedClip.g 1
  42.     lvchange 'CLIPS:$cedClip'
  43.     ; ask the CedHandler program to process it
  44.     call LVFormat agclean
  45.  
  46.     ; paste it back into ced
  47.     lvsave 'CLIPS:$cedClip'
  48.     SendRexx $cedport paste
  49.  
  50. ; -----------------------------------------------------
  51. ;    View guide
  52. ; -----------------------------------------------------
  53.  
  54. XICON 0 72 ":icons/eye"
  55.     gadid 11
  56.     guiwindow cedmark.g wait
  57.     ;  close previous window & file, if any
  58.     ifexists port CEDGUIDE
  59.        sendrexx CEDGUIDE QUIT
  60.     endif
  61.     ; get current file name
  62.     sendrexx $cedport 'status filename'
  63.     filename = $$rexxret
  64.     ; save file if it's been changed
  65.     sendrexx $cedport 'status numchanges'
  66.     if $$rexxret > 0
  67.        sendrexx $cedport 'save'
  68.     endif
  69.     ; load into lv, make it a node, save as tempnode & show it
  70.     lvuse cedbar.gc 20
  71.     lvchange $filename
  72.     lvgo first
  73.     if $$lv.rec[0][5] == "@data"
  74.        ; if it's a node add the @database stuff..
  75.     else
  76.        lvinsert -1 '@database Test\n@node MAIN "Main"\n'
  77.        lvadd '@endnode\n'
  78.     endif
  79.     lvsave t:tempnode
  80.     run 'amigaguide t:tempnode screen=$cedscreen port=CEDGUIDE'
  81.     guiwindow cedmark.g resume
  82.  
  83. ; -----------------------------------------------------
  84. ;    Join/Split guide
  85. ; -----------------------------------------------------
  86.  
  87. XICON 0 88 ":icons/AGSplit"
  88.     gadid 11
  89.     guiload :splitguide.g
  90.  
  91. XICON 0 102 ":icons/AGJoin"
  92.     gadid 11
  93.     guiload :joinguide.g
  94.  
  95.  
  96.